<template>
    <el-card class="box-card">
        <div slot="header" class="clearfix">
            <el-form :inline="true" :model="formSearchData" class="d-flex" size="small">
                <el-form-item label="">
                    <el-input v-model="formSearchData.keyword" placeholder="名称/ID"></el-input>
                </el-form-item>

                <el-form-item label="">
                    <el-select v-model="formSearchData.type" placeholder="类型">
                        <el-option
                            v-for="item in typeOptions"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>

                <el-form-item>
                    <el-button type="primary" @click="search">搜索</el-button>
                </el-form-item>
            </el-form>

        </div>

        <el-table
            :data="dataEntities"
            style="width: 100%">
            <el-table-column
                type="index"
                width="40">
            </el-table-column>
            <el-table-column
                prop="id"
                label="ID标识"
                >
            </el-table-column>
            <el-table-column
                prop="name"
                label="名称"
                >
            </el-table-column>
            <el-table-column
                prop="type_name"
                label="类型"
                >
            </el-table-column>


        </el-table>

        <div class="d-flex justify-content-end" >
            <div class="pager" v-html="dataPager">

            </div>
        </div>

    </el-card>
</template>

<script>


    export default {
        components: {},
        props: {
            dataEntities: {
                type: Array,
                default: []
            },
            dataSearch: {
                type: Object,
                default: {}
            },
            dataPager: {
                type: String,
                default: ''
            },
            typeOptions: {
                type: Array,
                default: []
            },

        },
        data() {
            return {
                formLabelWidth: window.formLabelWidth,
                formData: {},
                formErrors: {},
                formSearchData: {},
            }
        },
        created() {
            this.formSearchData = this.dataSearch;
            //console.log(this);
        },
        mounted() {
            let _this = this;

        },
        methods: {


            search:function () {
                this.formSearchData.pager_page = ''
                window.location.href = LeUtils.buildUrl(window.location.href,this.formSearchData);
            }
        }
    }
</script>
